<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="/jstl/cout" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@page import="com.infodms.dms.bean.AclUserBean"%>
<%@ page import="com.infodms.dms.common.Constant" %>
<%@ page import="com.infodms.dms.common.FileConstant"%>
<%
	AclUserBean user = (AclUserBean)request.getAttribute("user");
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/style/system.css" />
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/style/diaCnt.css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jslib/mootools.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/web/mtcommon.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/web/web.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/web/menu.js"></script>
<script type="text/javascript" src="<%=FileConstant.codeJsUrl%>"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/dict.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jslib/dialog_new.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jslib/DestoryPrototype.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jslib/prototype.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jslib/InfoAjax.js"></script>
<script>
	if( window.top.document != document ){
		window.top.document.location=document.location.href;
	}
	var path = "<%=request.getContextPath()%>";
	var sysfun_url = "<%=request.getContextPath()%>/common/MenuShow/getUserSysFun.json";
	var userfun_url = "<%=request.getContextPath()%>/common/MenuShow/getUserFuns.json";
	var tasklink_url = "<%=request.getContextPath()%>/common/MenuShow/getTaskLink.json";
	var shortcut_url = "<%=request.getContextPath()%>/common/MenuShow/getShortCutMenu.json";	
	var syspath = "<%=request.getContextPath()%>";

	
	function getInfo() {
		var flag ;
		var url = "<%=request.getContextPath()%>/common/UserManager/getUserInfo.json" ;
		if (<%=user.getOrgType().equals(Constant.ORG_TYPE_OEM) %>) {
			flag = 0 ;
			var iPoseId = '<%=user.getPoseId()%>' ;
			makeCall(url ,printInfo,{poseId:iPoseId, flag:flag}) ;
		}
		if (<%=!user.getOrgType().equals(Constant.ORG_TYPE_OEM) %>) {
			flag = 1 ;
			var iDealerId = '<%=user.getDealerId()%>' ;
			var iPoseId = '<%=user.getPoseId()%>' ;
			makeCall(url ,printInfo,{dealerId:iDealerId, poseId:iPoseId, flag:flag}) ;
		}
	}

	function printInfo(json) {
		document.all.divA.innerHTML = json.info ;
		
		if(json.isReport=='1'){
			document.getElementById("dayReport1").style.display = "inline";
			document.getElementById("dayReport2").style.display = "inline";
		}else{
			document.getElementById("dayReport1").style.display= "none";
			document.getElementById("dayReport2").style.display= "none";
		}
	}
	getInfo() ;

</script>
</head>
<body onload="getInfo() ;">
<form action="" id="fm"></form>
<div class="main_container" ondblclick="hideBox()"> 
	<!--########## Logo & 退出 部分 ##########====-->
	<div style="margin:0px 20px 0px 20px;">
	<table width="98%" cellpadding="0" cellspacing="0" border="0">
		<tr> 
			<td width="447" height="26"><img src="<%=request.getContextPath()%>/img/chana/LOGO-.jpg" /></td>
			<td valign="middle" nowrap="nowrap" >
			<div class="global_set">
				<ul>
					<li>
						<div style="color:#CC6600">
							<span id ="dayReport1">
								<!--<a style="color:#CC6600" href="<%=request.getContextPath()%>/sales/ordermanage/orderquery/DayReport/dayReportInit.do">当日销售看板</a>
								-->
								<a style="color:#CC6600" href="javascript:void(0)" onclick="dayReport();">当日销售看板</a>
							</span>
						</div>
					</li>
					<li><span id ="dayReport2">|</span></li>
					<li>
						<div style="color:#CC6600" id ="divA">
						</div>
					</li>
					<li>|</li>
					<li>
					<!-- =====================================BEGIN 隐藏部分 ================================== -->
						<div class="box" id="box" style="display:none;width:180px;position:absolute;">
							<iframe height="200" width="100%" frameborder="0" style="position:absolute;"></iframe>
							<div class="box_head" style="position:relative; cursor:pointer" onclick="hideBox()">
							<span id="boxTitle" class="left">信 息</span>
							<span class="right">
								<a class="roll" href="javascript:void(0)" onclick="hideBox();">&nbsp;</a>
							</span>
							<div style="clear:both"></div>
						</div>
						<div class="box_content" style="position:relative; height:233px;">
							<div style="padding:10px; " id="__box__">
							</div>
						</div>
					</div>	
					<!-- =====================================END 隐藏部分 ================================== -->
					<!-- <li>
						<img src="<%//=request.getContextPath()%>/img/L4.gif" />
						<input id="back" class="spc_btn" type="text" onblur="vvv(event,this)" onclick="showBox2('back');" onmouseover="showUnline(this)" onmouseout="hideUnline(this)" value="回访" readonly="true" /><strong><span id="hfc"></span></strong>
					</li>
					<li><img src="<%//=request.getContextPath()%>/img/L3.gif" />
						<input id="wait" class="spc_btn" type="text" onblur="vvv(event,this)" onclick="showBox2('wait');" onmouseover="showUnline(this)" onmouseout="hideUnline(this)" value="审批" readonly="true" /><strong><span id="spc"></span></strong>
					</li>
					<li><img src="<%//=request.getContextPath()%>/img/L2.gif" />
						<input id="do" class="spc_btn" type="text" onblur="vvv(event,this)" onclick="showBox2('do');" onmouseover="showUnline(this)" onmouseout="hideUnline(this)" value="待办" readonly="true" /><strong><span id="dbc"></span></strong>
					</li>
					<li>|</li>
					-->
					<li><a style="color:#CC6600" href="<%=request.getContextPath()%>/common/UserManager/logout.do">退 出</a></li>
<li>|</li>
					<li><a style="color:#CC6600" href="<%=request.getContextPath()%>/common/UserManager/login.do">职位切换</a></li>
                 </ul>
				<div style="clear:both;"></div>
			</div>
		    </td>
		</tr>
	</table>

	<!--########## 横向菜单 部分 ##########====-->	
	<table width="98%" height="100%" cellspacing="0" cellpadding="0" border="0" >
		<tr >
			<td width="163" valign="middle">
				<div class="global_welcome">欢迎您，<%=user.getName() %></div>
			</td> 
			<td colspan="2" align="left" valign="middle" style="background-color:#496EB1; margin:0px; padding:0px;">
				<div class="global_menu" id="lmenu">
				</div>
			</td>
		</tr> 
	</table> 
	<!--################################################################################====--> 
	<table id="test" width="98%" height="100%" cellspacing="1" cellpadding="0" border="0">
		<tr><td colspan="3" height="3"></td></tr>
		<tr> 
			<!--##########左边菜单 部分 ##########--> 
			<td id="sideBar"  valign="top">
				
				<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
					<tr>
						<td>
							<iframe id="menuIframe" name="menuIframe" width="160" height="100%" frameborder="0" scrolling="auto" style="overflow-x:hidden;overflow-y:visible;" ></iframe>
						</td>
					</tr>
					<tr>
						<td id="quick_link" valign="top">
							<div class="quick_link_box" id="mylink" ></div>
						</td>
					</tr>
				</table>
			</td> 
			<td id="arrow" width="12" onmouseout="styleBack(this)" onmouseover="styleChange(this)" onclick="showSildBar()" style="border-left:1px solid #CCC;cursor:pointer;">
				<img style="display:none;" id="ImgArrow" border="0" title="展开/折叠" name="ImgArrow" />
			</td> 
			<!--##########=右边内容框 部分 ##########--> 
			<td valign="top"> 
				<iframe id="inIframe" name="inIframe" width="100%" height="650" scrolling="yes" style="overflow-x:hidden;overflow-y:visible;" frameborder="0"></iframe>
			</td> 
		</tr> 
	</table> 
	</div>
</div> 
<script>
	function winopen (url){
		window.open(url, "", "width=1000px,height=420px,left=50,top=80,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no maximum=yes");
	}
	function dayReport(){
		winopen("<%=request.getContextPath()%>/sales/ordermanage/orderquery/DayReport/dayReportInit.do");
	}

	function dayReport1(){
		alert(1);
	}
	
	/*--------------------------------------Resize效果------------------------------------*/

	function common(){
		$('inIframe').height = eval(document.body.offsetHeight - 78);
		var length = ($('inIframe').height - 20);
		$('menuIframe').height = eval(length)*0.7;
		$('quick_link').height = eval(length)*1/3;
	}
	
	window.onresize = function(){
		common();
	}
	
	window.onload = function(){
		 common();
		 loadMenuPage();
	}

	window.onunload=function()
	{
		if(event.clientX<=0 && event.clientY<0) { 
			window.location.href = "<%=request.getContextPath()%>/common/UserManager/logout.do";
		}
	}

	window.onbeforeunload=function()  
    {        
    	var n = window.event.screenX - window.screenLeft;
      	var b = n > document.documentElement.scrollWidth-20;
      	if(b && window.event.clientY < 0 || window.event.altKey)
      	{
      		window.location.href = "<%=request.getContextPath()%>/common/UserManager/logout.do";
      	}   
    } 
    
	function toPsn() {
		$("inIframe").src = "<%=request.getContextPath()%>/welcome.jsp";
	}

	function getposition(obj) {
		var r = new Array();
		r['x'] = obj.offsetLeft;
		r['y'] = obj.offsetTop;
		while(obj = obj.offsetParent) {
		   r['x'] += obj.offsetLeft;
		   r['y'] += obj.offsetTop;
		}
		return r;
	}
	
	function vvv(event,obj) {

		var p = getposition(document.getElementById('box'));
	   var tempa = ((p['x']) + ($('box').getStyle("width")).toInt()).toInt();
	   var tempb = ((p['y']) + ($('box').getStyle("height")).toInt()).toInt();

	   var st = false;
	   if(event.clientX > p['x'] && event.clientX < tempa && event.clientY > p['y'] && event.clientY < tempb) {
			st = true;
			obj.focus();
	   }
	   if(!st) {
			hideBox();
	   }
	}

	function showUnline(obj){
		obj.style.textDecoration='underline';
	}
	function hideUnline(obj){
		obj.style.textDecoration='none';
	}
	function showBox2(id) {

		if(document.all){
			$('box').style.marginLeft = '-28px';
		}else{
			$('box').style.marginLeft = '-16px';
		}
		
		$('box').style.marginTop = '20px';

		$('box').setStyle("display","");
		$('boxTitle').innerHTML = $(id).value;
		if(id == "back") {

			var intesr = "";

			if(hf != null && hf.length > 0) {
				for(var i=0; i<hf.length; i++) {
					var a = hf[i].createDate;
					a = a.substring(0,10);
					if(i==5) {
						intesr += "<tr><td colspan='2'><a href='javascript:void(0)' onclick='toPsn()'>"+a+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...</a></td></tr>";
						break;
					}
					intesr += "<tr><td colspan='2'><a href='javascript:void(0)' onclick='toPsn()'>"+a+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+hf[i].operateType+"</a></td></tr>";
				}
			}
			
			$('__box__').innerHTML = "<table class='tb_list' border='0' style='border:none' ><th>时间</th><th>类型</th>"+intesr+"</table>";
		} else if(id == "wait") {
			var intesr = "";

			if(sp != null && sp.length > 0) {
				for(var i=0; i<sp.length; i++) {
					var a = sp[i].createDate;
					a = a.substring(0,10);
					if(i==5) {
						intesr += "<tr><td colspan='2'><a href='javascript:void(0)' onclick='toPsn()'>"+a+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...</a></td></tr>";
						break;
					}
					intesr += "<tr><td colspan='2'><a href='javascript:void(0)' onclick='toPsn()'>"+a+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+sp[i].operateType+"</a></td></tr>";
				}
			}
			
			$('__box__').innerHTML = "<table class='tb_list' border='0' style='border:none' ><th>时间</th><th>类型</th>"+intesr+"</table>";
		} else if(id == "do") {
			var intesr = "";
			var ti = 0;
			if(db1 != null && db1.length > 0) {
				for(var i=0; i<db1.length; i++) {
					var a = db1[i].createDate;
					a = a.substring(0,10);
					++ti;
					if(ti == 6) {
						intesr += "<tr><td colspan='2'><a href='javascript:void(0)' onclick='toPsn()'>"+a+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...</a></td></tr>";
						break;
					}
					intesr += "<tr><td colspan='2'><a href='javascript:void(0)' onclick='toPsn()'>"+a+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+db1[i].operateType+"</a></td></tr>";
				}
			}

			if(ti < 6 && db2 != null && db2.length > 0) {
				for(var i=0; i<db2.length; i++) {
					var a = db2[i].createDate;
					a = a.substring(0,10);
					++ti;
					if(ti == 6) {
						intesr += "<tr><td colspan='2'><a href='javascript:void(0)' onclick='toPsn()'>"+a+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...</a></td></tr>";
						break;
					}
					intesr += "<tr><td colspan='2'><a href='javascript:void(0)' onclick='toPsn()'>"+a+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+db2[i].operateType+"</a></td></tr>";
				}
			}

			if(ti < 6 && db3 != null && db3.length > 0) {
				for(var i=0; i<db3.length; i++) {
					var a = db3[i].createDate;
					a = a.substring(0,10);
					++ti;
					if(ti == 6) {
						intesr += "<tr><td colspan='2'><a href='javascript:void(0)' onclick='toPsn()'>"+a+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...</a></td></tr>";
						break;
					}
					intesr += "<tr><td colspan='2'><a href='javascript:void(0)' onclick='toPsn()'>"+a+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+db3[i].operateType+"</a></td></tr>";
				}
			}

			if(ti < 6 && db4 != null && db4.length > 0) {
				for(var i=0; i<db4.length; i++) {
					var a = db4[i].createDate;
					a = a.substring(0,10);
					++ti;
					if(ti == 6) {
						intesr += "<tr><td colspan='2'><a href='javascript:void(0)' onclick='toPsn()'>"+a+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...</a></td></tr>";
						break;
					}
					intesr += "<tr><td colspan='2'><a href='javascript:void(0)' onclick='toPsn()'>"+a+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+db4[i].operateType+"</a></td></tr>";
				}
			}
			
			if(ti < 6 && db5 != null && db5.length > 0) {
				for(var i=0; i<db5.length; i++) {
					var a = db5[i].createDate;
					a = a.substring(0,10);
					++ti;
					if(ti == 6) {
						intesr += "<tr><td colspan='2'><a href='javascript:void(0)' onclick='toPsn()'>"+a+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...</a></td></tr>";
						break;
					}
					intesr += "<tr><td colspan='2'><a href='javascript:void(0)' onclick='toPsn()'>"+a+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+db5[i].operateType+"</a></td></tr>";
				}
			}
			
			if(ti < 6 && db6 != null && db6.length > 0) {
				for(var i=0; i<db6.length; i++) {
					var a = db6[i].createDate;
					a = a.substring(0,10);
					++ti;
					if(ti == 6) {
						intesr += "<tr><td colspan='2'><a href='javascript:void(0)' onclick='toPsn()'>"+a+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...</a></td></tr>";
						break;
					}
					intesr += "<tr><td colspan='2'><a href='javascript:void(0)' onclick='toPsn()'>"+a+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+db6[i].operateType+"</a></td></tr>";
				}
			}
			
			$('__box__').innerHTML = "<table class='tb_list' border='0' style='border:none' ><th>时间</th><th>类型</th>"+intesr+"</table>";
		}
	}
	
	function styleChange(obj){		
		obj.width = 12;
		$('ImgArrow').style.display = '';
		if(getSatus() == 0){
			$('ImgArrow').src = '<%=request.getContextPath()%>/img/exBn1.gif';
		}else{
			$('ImgArrow').src = '<%=request.getContextPath()%>/img/exBn2.gif';
		}
	}
	
</script>

</body>
</html>
